<?
require_once 'Controller/LoginController.php';
$login = LoginController::singleton();

function getNavbar() {
    $login = LoginController::singleton();
    $gets = explode("/", $_SERVER['REQUEST_URI']);
    $secao = (isset($gets[2])) ? $gets[2] : NULL;
    ?>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="navbar-inner">
            <div class="span4" style="margin: 0px;">
                <a class="brand" href=""><img src="/Versao1/img/IconTH.png" style="margin: 0px; padding: 0px; max-height: 30px; position: fixed; z-index: 1000; top: 5px; left: 5px;"></a>  
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="nav-collapse collapse">
                    <ul class="nav" style="margin-left: 40px;">
                        <?
                        if ($secao == 'universitario') {
                            ?>
                            <li class=""><a href="/Versao1">Principal</a></li>
                            <li class="active"><a href="/Versao1/universitario">Universitario</a></li>
                            <?
                        } else {
                            ?>
                            <li class="active"><a href="/Versao1">Principal</a></li>
                            <li ><a href="/Versao1/universitario">Universitario</a></li>
                            <?
                        }
                        ?>
                    </ul>
                </div>

            </div>
            <div class="span5 visible-desktop">
                <center><!--Arrumar isso aqui-->  
                    <div class="navbar-form">
                        <form class="form-search" style="margin: 0px" method="POST" action="/Versao1/busca">
                            <input type="hidden" name="formBuscaEspecifico" value="formBuscaEspecifico"/>
                            <div class="input-append">
                                <input type="text" class="span4 search-query" name="search" placeholder="Buscar Evento, Empresa ou Republicas">
                                <button type="submit" class="btn"><i class="icon-search"></i> Search</button>
                            </div>
                        </form>
                    </div>
                </center>
            </div>
            <div class="span3">
                <!-- Button to trigger modal -->
                <?
                $login->getBarraLogin();
                ?>
            </div>
        </div>
    </div>
    <!-- Modal -->
    <div id="modalLogin" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="myModalLabel">Login</h3>
        </div>
        <div class="modal-body">
            <form class="form-horizontal" method="POST" action="">
                <div class="control-group">
                    <label class="control-label" for="edtEmail">Email</label>
                    <div class="controls">
                        <input type="email" id="edtEmail" name="edtEmail" placeholder="Email" required="true">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="edtSenha">Password</label>
                    <div class="controls">
                        <input type="password" id="edtSenha" name="edtSenha" placeholder="Password" required="true">
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <button type="submit" class="btn">Entrar</button>
                    </div>
                </div>
            </form>
            <a href="https://www.facebook.com/dialog/oauth?client_id=500294773382967&redirect_uri=http://www.tudohoje.com.br">Entrar com Facebook</a>

        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">Fechar</button>
        </div>
    </div>

    <!-- Modal -->
    <div id="modalCadastro" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header" style="">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color: white">×</button>
            <h3 id="myModalLabel">Cadastro</h3>
        </div>
        <div class="modal-body">
            <form class="form-horizontal" method="POST" action="">
                <input type="hidden" id="formCadastroUsuarioSimples" name="formCadastroUsuarioSimples" value="formCadastroUsuarioSimples"/>
                <div class="control-group">
                    <label class="control-label" for="edtNome">Nome</label>
                    <div class="controls">
                        <input type="text" id="edtNome" name="edtNome" placeholder="Nome" required="true">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="edtEmail">Email</label>
                    <div class="controls">
                        <input type="email" id="edtEmail" name="edtEmail" placeholder="Email" required="true">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="edtSenha">Password</label>
                    <div class="controls">
                        <input type="password" id="edtSenha" name="edtSenha" placeholder="Password" required="true">
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <button type="submit" class="btn">Cadastrar</button>
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <a href="cadastro" class="btn pull-left" aria-hidden="true" >Sou uma empresa</a>
            <!--<a href="cadastro" class="btn pull-left" aria-hidden="true">Quero ser um promotor</a>-->
            <button class="btn" data-dismiss="modal" aria-hidden="true">Fechar</button>
        </div>
    </div>
    <?
}
?>